using System;
using System.Collections;
using System.Collections.Generic;
namespace Circus.Syntax.Lexer
{
	public class LexStates : List<LexState>, IList<LexState>, ICollection<LexState>, IEnumerable<LexState>, IEnumerable
	{
		private LexScheme scheme;
		public LexStates(LexScheme owner)
		{
			this.scheme = owner;
		}
		public virtual LexState AddLexState()
		{
			LexState lexState = new LexState(this.scheme);
			base.Add(lexState);
			return lexState;
		}
		public virtual LexState InsertLexState(int index)
		{
			LexState lexState = new LexState();
			base.Insert(index, lexState);
			return lexState;
		}
		public virtual LexState FindLexState(string name)
		{
			LexState result;
			foreach (LexState current in this)
			{
				if (current.Name == name)
				{
					result = current;
					return result;
				}
			}
			result = null;
			return result;
		}
	}
}
